/**
 * Copyright (c) 2017, Alex. All rights reserved.
 */
package com.oschina.bottle.sample.web.controller;

import com.oschina.bottle.common.exception.BaseException;
import com.oschina.bottle.common.model.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author <a href="mailto:zhongchao@gegejia.com">zhong</a>
 * @version 1.0 2017/10/11
 * @since 1.0
 */
@RequestMapping("/")
@RestController
public class TestController
{
    @GetMapping("/hello")
    private Result hello() {
        return Result.success("Hello World");
    }

    public Result exception() {
        throw new BaseException(2, "资源不存在");
    }
}
